/*
 * Restaurant class is an object relating to each restaurant account in the server
 */

package com.object;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import com.configuration.Configuration;

public class Restaurant {
	private int _id;					// Restaurant ID of the restaurant (relative to the table restaurant->id field)
	private String _name;				// Name of restaurant
	private String _address;			// Address of restaurant
	private String _telephone;			// Telephone of restaurant
	private String _openHours;			// Open Hours of the restaurant
	private String _description;		// Description of the restaurant
	private String _profilePicture;		// URL of the profile picture of the restaurant 
	private String _tag;				// Contains multiple tags in the ww,xx,yy,zz,, form
	private String _coupon;				// URK of the coupon picture of the restaurant
	
	public Restaurant(int id, String name,String address,String telephone,String openHours,String description,String profilePicture,String tag,String coupon){
		_id = id;
		_name = name;
		_address = address;
		_telephone = telephone;
		_openHours = openHours;
		_description = description;
		_profilePicture = profilePicture;
		_tag = tag;
		_coupon = coupon;
	}
	
	public int getId(){
		return _id;
	}
	
	public String getName(){
		return _name;
	}
	
	public String getAddress(){
		return _address;
	}
	
	public String getTelephone(){
		return _telephone;
	}
	
	public String getOpenHours(){
		return _openHours;
	}
	
	public String getDescription(){
		return _description;
	}
	
	public String getProfilePicture(){
		return _profilePicture;
	}
	
	/*
	 * return null if invalid index entered
	 * accepted value : 0 ~ Configuration.tagNumber-1
	 */
	public String getTagByIndex(int index){
		List<String> list = new ArrayList<String>(Arrays.asList(_tag.split(",")));
		if(index<list.size() && index>-1){
			return list.get(index);
		}else{
			return "";
		}
		
	}
	
	public String getCoupon(){
		return _coupon;
	}
	
}
